home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c++,comp.lang.c,comp.arch,comp.arch.embedded
- Subject: Re: C++ -> C compiler
- Date: 05 Mar 1996 22:17:15 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Mar5151715@qcd.lanl.gov>
- References: <313C8FE9.1EE1@iastate.edu> <4hhtpiINN4h9@keats.ugrad.cs.ubc.ca>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: c2a192@ugrad.cs.ubc.ca's message of 5 Mar 1996 09:31:30 -0800
-
- In article <4hhtpiINN4h9@keats.ugrad.cs.ubc.ca>
- c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) writes:
-
- <snip>
- KK: This has been done. Some 'CC' compilers work by translating C++ to C.
- KK:
- KK: hp-ux$ man CC
- <snip>
- KK: CC (capital CC) is the HP-UX C++ translator/compiler. In translator
- KK: mode CC translates C++ source code to C source code. In
- compiler mode
- KK: CC compiles C++ source code directly to object code.
- KK:
- KK: The command uses cpp(1) for preprocessing, cfront for syntax and type
- KK: checking, as well as for code generation in compiler mode, and cc(1)
- KK: for code generation in translator mode.
-
- How does cpp handle the following code? (Remember this is a syntax
- error in C, and is equivalent to junk = sometoken - 3 + 3 in C++. What
- I am afraid is your compiler might compile it to junk = sometoken + 3.)
-
-
- #define mytoken sometoken // a comment
-
- junk = mytoken - 3
- + 3;
-
- Or does cpp have a C mode and a C++ mode?
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-